<!-- Custom styles for this page -->
<link href="<?php echo Yii::$app->params['jicDomain']?>/admin/css/dataTables.bootstrap4.min.css" rel="stylesheet">

<!-- Begin Page Content -->
<div class="container-fluid">

  <!-- Page Heading -->
  <h1 class="h3 mb-2 text-gray-800">后台管理账号</h1>
  <p class="mb-4">DataTables is a third party plugin that is used to generate the demo table below. For more information about DataTables, please visit the <a target="_blank" href="https://datatables.net">official DataTables documentation</a>.</p>

  <!-- DataTales Example -->
  <div class="card shadow mb-4">
    <div class="card-header py-3">
      <h6 class="m-0 font-weight-bold text-primary">列表</h6>
    </div>
    <div class="card-body">
      <div class="table-responsive">
        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
          <thead>
            <tr>
              <th>账号</th>
              <th>最后登录ip</th>
              <th>最后登录时间</th>
              <th>注册时间</th>
              <th>状态</th>
              <th>操作</th>
            </tr>
          </thead>
          <tfoot>
            <tr>
              <th>账号</th>
              <th>最后登录ip</th>
              <th>最后登录时间</th>
              <th>注册时间</th>
              <th>状态</th>
              <th>操作</th>
            </tr>
          </tfoot>
          <tbody>
            <?php 
            if (!empty($userList)) {
                echo "<tr>";
                foreach ($userList as $info) {
                    echo "<td>{$info['username']}</td>";
                    echo "<td>{$info['last_login_ip']}</td>";
                    echo "<td>{$info['last_login_time']}</td>";
                    echo "<td>" . date('Y-m-d H:i:s', $info['created_at']) . "</td>";
                    if ($info['status'] == 0) {
                        echo "<td>已删除</td>";
                        echo "<td>";
                        echo "<a href=''>删除</a>";
                        echo "</td>";
                    } elseif ($info['status'] == 1) {
                        echo "<td>待审核</td>";
                        echo "<td>";
                        echo "<a href=''>审核通过</a>";
                        echo "</td>";
                    } elseif ($info['status'] == 2) {
                        echo "<td>正常</td>";
                        echo "<td>";
                        echo "<a href=''>删除</a>";
                        echo "</td>";
                    }
                    
                }
                echo "</tr>";
            }
            ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>

</div>
<!-- /.container-fluid -->


<!-- Page level plugins -->
<script src="<?php echo Yii::$app->params['jicDomain']?>/common/web/js/jquery.dataTables.min.js"></script>
<script src="<?php echo Yii::$app->params['jicDomain']?>/admin/js/dataTables.bootstrap4.min.js"></script>

<!-- Page level custom scripts -->
<script src="<?php echo Yii::$app->params['jicDomain']?>/admin/js/demo/datatables-demo.js"></script>
